<<<<<<< HEAD:pages/home/home.js
// pages/home/home.js
=======
// page/indent/indent.js
// 获取应用实例
const app = getApp()
const api = require('../../config.js');
const http = require('../../http/http.js')
>>>>>>> f4a073b739d15713d91a4b256e2ec81948778648:page/home/home.js
Page({


      /**
       * 页面的初始数据
       */
      data: {
        currentTab: 0,
        shangx: "0",
        getLocation: [],
        callme: [],
        fenlei:[],
        yifu:[],
        meishi:null,
        indicatorDots: true,
        autoplay: false,
        interval: 5000,
        duration: 1000,
        // 头部组件
        nvabarData: {
          showCapsule: 0, //是否显示左上角图标   1表示显示    0表示不显示
          title: '首页', //导航栏 中间的标题
          statusBarHeight: null,

        },


        // 此页面 页面内容距最顶部的距离
        height: app.globalData.height * 2 + 20,
      },
      clickTab: function(e) {
        var that = this;
        if (this.data.currentTab === e.target.dataset.current) {
          return false;
        } else {
          that.setData({
            currentTab: e.target.dataset.current,
          })
        }
      },
      Tab: function(e) {
        var that = this;
        console.log(e.target.dataset.current)
        if (this.data.shangx === e.target.dataset.current) {
          return false;
        } else {
          that.setData({
            shangx: e.target.dataset.current,
          })
        }
      },
      getLocation: function() {
        wx.getLocation({
          type: 'wgs84',
          success: function(res) {
            wx.openLocation({ //​使用微信内置地图查看位置。
              latitude: 29.6463000000, //要去的纬度-地址
              longitude: 91.1469500000, //要去的经度-地址
              name: "西藏拉萨市城关区吉日街道办事处江苏路36号",
              address: '西藏拉萨市城关区吉日街道办事处江苏路36号'
            })
          }
        })
      },
      // 打电话
      callme: function() {
        wx.makePhoneCall({
          phoneNumber: "17535815094",
        })
      },
      
      onShow: function() {
        
      },
      /**
       * 生命周期函数--监听页面卸载
       */
      onUnload: function() {


      },
      onLoad: function(options) {
        var that = this;
        http( //首页
          "https://web-gateway.newbeescm.com/ms-web/shopGoodsCategory/homeCategoryList",
          "params", {
            shopId: 18,
            storeId: 56200
          },
          "POST"
        ).then(res => {
          console.log("enenenenene", res);
          that.setData({
            fenlei: res.data.result,
          })
        }),
          http(
            api.ing1,
            "data", {
              "status": "1",
              "shopId": 18,
              "storeId": 1558,
<<<<<<< HEAD
<<<<<<< HEAD
              "salesCategoryId": 1680037, 
=======
              "salesCategoryId": 1680037,
>>>>>>> 首页部分接口 商品地图完善  定位新增地址没完善 大部分效果以显示
=======
              "salesCategoryId": 1680037, 
>>>>>>> 搜索框功能没实现 团购 当前位置
              "sortType": 5,
              "isAsc": false,
              "teminal": 2,
              "customerId": 589,
              "currentPage": 0,
              "pageSize": 15
            },
            "post",
          ).then(res => {
            that.setData({
              yifu: res.data.result.items,
            })
            console.log(res);
            console.log(that.data.yifu)
          }),

        http(
          api.ing1,
          "data",
          {
            "status": "1",
            "shopId": 18,
            "storeId": 1558,
            "salesCategoryId": 1700002,
            "sortType": 5,
            "isAsc": false,
            "teminal": 2,
            "customerId": 589,
            "currentPage": 0,
            "pageSize": 15
          },
          "post"
        ).then(res => {
          this.setData({
            meishi: res.data.result.items
          })
          console.log("ddd", res.data.result.items);
          console.log("kkk", this.data.meishi);
        })
        
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 搜索框功能没实现 团购 当前位置

        // http(
        //   api.ing2,
        //   "data",
        //   {
        //     customerId: 589,
        //     shopId:18,
        //     goodsId:,
        //     quantity: ,
        //     teminal: 2,
        //     storeId: 1558,
        //   },
        //   "post"
        // ).then(res => {
        //   this.setData({
        //     meishi: res.data.result.items
        //   })
        //   console.log("ddd", res.data.result.items);
        //   console.log("kkk", this.data.meishi);
        // })
      },

<<<<<<< HEAD
=======
      },
>>>>>>> 首页部分接口 商品地图完善  定位新增地址没完善 大部分效果以显示
=======
>>>>>>> 搜索框功能没实现 团购 当前位置
  take(e) {
    console.log(e)
    wx.navigateTo({
      url: '../take/take'
    })
  },
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 搜索框功能没实现 团购 当前位置
  group(e){
    console.log(e)
    wx.navigateTo({
      url: '../group/group'
    })
  },
  seek(e) {
    console.log(e)
    wx.navigateTo({
      url: '../seek/seek'
    })
  },
<<<<<<< HEAD
 
   
   
})
=======
=======
>>>>>>> 搜索框功能没实现 团购 当前位置
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {


  },


  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {


  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {


  }
})
>>>>>>> 首页部分接口 商品地图完善  定位新增地址没完善 大部分效果以显示
